import os
import launch
import launch_ros
from ament_index_python import get_package_share_directory
from launch.launch_description_sources import PythonLaunchDescriptionSource

def generate_launch_description():
   autopatrol_robot_dir = get_package_share_directory('autopartol_robot')
   patrol_config_path = os.path.join(autopatrol_robot_dir,'config','partol_config.yaml')

   action_node_turtle_control = launch_ros.actions.Node(
      package='autopartol_robot',
      executable='partol_node',
      output='screen',
      parameters=[patrol_config_path],
   )

   action_node_patrol_client=launch_ros.actions.Node(
      package='autopartol_robot',
      executable='speaker',
      output='screen',
   )

   return launch.LaunchDescription([
      action_node_turtle_control,
      action_node_patrol_client
   ])